const express = require("express");
const cors = require("cors");
const bodyParser = require("body-parser");
//引入路由器文件
const studentRouter = require('./router/student');

const app = express();
//静态文件
app.use(express.static("public"));
//解决跨域
app.use(cors());
app.use(bodyParser.urlencoded({extended:true}));
//应用路由
app.use(studentRouter);

app.listen(3000,err=>{
    if(!err) console.log("服务器启动成功！");
    else console.log(err);
})